package com.cxl.springbootMybatisWeb.config;

import java.util.Properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.github.pagehelper.PageInterceptor;

/**
 * Function: TODO ADD FUNCTION. <br/>
 * Date: 2018年4月22日 下午11:42:12 <br/>
 *
 * @author XilinCheng
 * @version 1.0
 * @Copyright (c) 2018, CXL  All Rights Reserved.
 */
@Configuration
public class PageHelperConfig {
    @Value("${pagehelper.helperDialect}")
    private String helperDialect;


    @Bean
    public PageInterceptor pageInterceptor(){
        PageInterceptor pageInterceptor = new PageInterceptor();
        Properties properties = new Properties();
        properties.setProperty("helperDialect", helperDialect);
        pageInterceptor.setProperties(properties);
        return pageInterceptor;
    }
}

